﻿<!--#include file="../Include/Config.asp"-->
<link rel="stylesheet" href="../Css/Admin.css" type="text/css" />
   <table cellSpacing=0 cellPadding=0 width=740 border=0 class="table">
   <tbody>
   <tr>
    <th width="123">序号</th>
    <th width="150">链接名称</th>
    <th width="149">链接地址</th>
    <th width="220">LOGO</th>
    <th width="110">链接备注</th>
    <th width="106">通过审核</th>
    <th width="117">操作</th>
  </tr>
<%
dim page_size,rscount,item_count,page_num,page_now,i
page_size=10
set rscount=conn.execute("select count(*) as item_count from friendlink")
	item_count=cint(rscount("item_count"))
	rscount.close
    page_num=item_count\page_size 
sql="select * from friendlink order by Link_id desc"
rs.CursorLocation = 3
rs.open sql,conn,1,3
if not rs.eof then
	rs.pagesize=page_size
	page_now=1
	if trim(request.QueryString("page"))<>"" then
	page_now=cint(trim(request.QueryString("page")))
	end if
	if page_now>rs.pagecount or page_now<0 then
	page_now=1
	end if
	rs.absolutepage=page_now
    i=1
  while not rs.eof and i<page_size+1
%>
  <tr>
    <td><%=i%></td>
    <td><a href="<%=rs("Link_url")%>" target="_blank"><%=rs("Link_name")%></a></td>
    <td><a href="<%=rs("Link_url")%>" target="_blank"><%=rs("Link_url")%></a></td>
    <td>
	<%
	if left(rs("Link_imgurl"),4)="http" then
	response.Write("<img src="""&rs("Link_imgurl")&""" height=""50"" width=""80""/>")
	else
	response.Write("<img src=""../"&rs("Link_imgurl")&""" height=""50"" width=""80""/>")
	end if
	%>
	
	</td>
    <td><%=rs("Link_info")%></td>
    <td><%SwitchBoolean(rs("Link_state"))%></td>
    <td><a href="FriendLinkEdit.asp?Link_id=<%=rs("Link_id")%>">编辑</a>|<a href="#"onclick="javascript:if (confirm('确认删除&nbsp;?')) href='FriendLinkDel.asp?FriendLink_id=<%=rs("Link_id")%>';else return;">删除</a></td>
  </tr>
<%
   rs.movenext
   i=i+1
  wend
%>  
  <tr>
    <td colspan="7" align="right">
  <div id="bottom_pagebox" style="padding-right:50px;">
  当前第<%=page_now%>页
  <%if page_now=1 then%>首页
  <%else%><a href="FriendLinkAdmin.asp?page=1">首页</a>
  <%end if%>
  <%if page_now>1 and rs.pagecount>1 then%>
  <a href="FriendLinkAdmin.asp?page=<%=page_now-1%>">上一页</a>
  <%else%>上一页
  <%end if%>				
  <%if page_now<rs.pagecount then%> 
  <a href="FriendLinkAdmin.asp?page=<%=page_now+1%>">下一页</a>
  <%else%>下一页
  <%end if%>				
  <%if page_now<>rs.pagecount then%> 
  <a href="FriendLinkAdmin.asp?page=<%=rs.pagecount%>">尾页</a>
  <%else%>尾页
  <%end if%>
  共<%=rs.pagecount%>页/<%=item_count%>项</div>
	</td>
  </tr>
<%
else
%>	
  <tr>
    <td colspan="7">暂时没有友情链接，请<a href="FriendLinkAdd.asp">添加</a></td>
  </tr>
<%
end if
rs.close
%>
  </tbody>
</table>
   
